checkAndUpdateSession();

function checkAndUpdateSession(){
    console.log('checkAndUpdateSession')
    console.log(window.location.href)
    let p1 = GetQueryString('pppp1');
    let p2 = GetQueryString('pppp2'); // window.location.href.indexOf('AAAASSSSSS')>-1
    console.log(p1,p2)
    // let arr = window.location.href.split('/')
    // let p1 = arr[arr.length-2];
    // let p2 = arr[arr.length-1];
    if(p1 && p2 && (!sessionStorage.getItem('X-Client-PC-Access-Token') || sessionStorage.getItem('X-Client-PC-Access-Token') == '123456789' )){
        sessionStorage.setItem('X-Client-PC-Access-Token',p1)
        sessionStorage.setItem('X-Visitor-Id',p2)      
        sessionStorage.setItem('X-Project-Id',4)   
        sessionStorage.setItem('X-Team-Code', '19029219')
        sessionStorage.setItem('X-Nav-Type', '2')

        // window.location.href='https://dev.open.10086.cn/web/'
    }
}


function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
    var context = "";
    if (r != null)
        context = decodeURIComponent(r[2]);
    reg = null;
    r = null;
    return context == null || context == "" || context == "undefined" ? "" : context;
}

